package com.baizhi.appcontroller;

import com.baizhi.entity.CmfzAudio;
import com.baizhi.service.CmfzAudioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: renpu
 * @Date: 2019/3/6 21:16
 * @Description:
 */
@RestController
@RequestMapping("/Audio")
public class AudioController {
    @Autowired
    private CmfzAudioService audioService;

    @GetMapping("selectAudio")
    public List<CmfzAudio> selectAudio(){
        return audioService.selectAudio();
    }

    @GetMapping("selectAlbum/{id}")
    public CmfzAudio selectAlbum(@PathVariable("id") int album_id){
        return audioService.selectBulum(album_id);
    }

    @GetMapping("selectCountIdAudio/{id}")
    public int selectCountIdAudio(@PathVariable("id") int album_id){
        return audioService.selectCount(album_id);
    }

    @GetMapping("selectAudioTwo/{id}")
    public List<CmfzAudio> selectAudioTwo(@PathVariable("id") int album_id){
        return audioService.selectAudioTwo(album_id);
    }

}
